package com.study.designmodel.abstractfactory;

/**
 * @description: FactoryProducer工厂类生产器，通过传递颜色或者形状信息选择工厂用的
 * @date: 2021/2/4 11:29
 * @author: hcm
 * @version: 1.0
 */
public class FactoryProducer {
    public static AbstractFactory getFactory(String choice){
        if(choice.equalsIgnoreCase("shape")){
            return new ShapeFactory();
        }else if(choice.equalsIgnoreCase("color")){
            return new ColorFactory();
        }
        return null;
    }
}
